<template>
  <div>
    <div class="header">
      <div class="TLimg">
        <img src="../assets/tllogo.png" alt="" />
      </div>
      <slot></slot>
      <div class="searchbox">
        <a-input-search placeholder="搜索课程" size="large" @search="onSearch">
          <a-button slot="enterButton">
            <a-icon type="search" />
            搜索
          </a-button>
        </a-input-search>
      </div>

      <div class="lodinbox">
        <loginPage></loginPage>
      </div>
    </div>
    <div navlist>
      <div class="head-nav">
        <ul class="headlist">
          <li class="navItem navItems">首页</li>
          <li class="navItems course-classify">
            <a-dropdown>
    <a class="ant-dropdown-link" @click="e => e.preventDefault()">
    课程分类 <a-icon type="down" />
    </a>
    <a-menu slot="overlay" @click="onClick">
        <!-- <div v-for="(item,index) in courseList" :key="index"> -->
      <a-menu-item  v-for="(item,index) in classList" :key="index">
        {{item.title}}
      </a-menu-item>
        <!-- </div> -->
      
    </a-menu>
  </a-dropdown>
          </li>
          <li class="navItems">专属课程</li>
        </ul>
      </div>
    </div>
  </div>
</template>
<script>
import loginPage from "./LoginPage.vue"
export default {
  name: "IndexHeader",
  components:{
        loginPage,
    },
  data(){
      return {
          classList:"[]"
      }
  },
  created(){
      this.$axios.post("/api/weChat/applet/subject/list",{enable:1}).then(res=>{
          console.log(res);
          this.classList=res.data.rows
      })
  }
};
</script>
<style lang="less" scoped>
* {
  padding: 0;
  margin: 0;
  box-sizing: border-box;
}
a {
  color: black;
  text-decoration: none;
}
a:hover {
  color: red;
}
ul {
  list-style: none;
}
.header {
  margin: auto;
  width: 1200px;
  height: 106px;
}
.TLimg {
  float: left;
  width: 179px;
  height: 55px;
  margin-top: 22px;
  margin-right: 200px;
}
// /deep/.ant-input-wrapper {
//     height: 60px;
//     width: 100%;
// }
/deep/.ant-input {
  border-radius: 19px 0 0 19px;
  height: 38px;
}
/deep/.ant-btn {
  width: 90px;
  height: 38px;
  border-radius: 0 19px 19px 0;
  background-color: #1da57a;
  color: #fff;
}
.searchbox {
  float: left;
  margin-top: 30px;
  width: 400px;
  height: 38px;
}
.lodinbox {
  float: right;
  margin-top: 30px;
  width: 142px;
  height: 34px;
  line-height: 34px;
  // background-color: red;
}
.lodinbox > span:nth-of-type(1) {
  font-size: 20px;
  color: #999;
}
.lodinbox > span:nth-of-type(2) {
  font-size: 14px;
}
.lodinbox > span:nth-of-type(3) {
  display: inline-block;
  width: 32px;
  height: 32px;
  background-color: #ccc;
  border-radius: 16px;
}
.shopping-cart {
  font-size: 20px;
  color: #999;
}
.user {
  font-size: 16px;
  color: #fff;
}
.navlist {
  width: 1200px;
}
.head-nav {
  position: relative;
  margin: auto;
  width: 1200px;
  height: 30px;
}
.headlist {
  overflow: hidden;
  position: relative;
}
.headlist > li {
  float: left;
  margin: 0 30px 0 0;
  font-size: 16px;
}
/* .headlist>li:hover {
    color: #00cf8c;
} */
.navItem {
  padding-bottom: 5px;
  border-bottom: 2px solid #00cf8c;
  color: #00cf8c;
}
.course-classifylist {
  position: relative;

  z-index: 1066;
  background-color: #fff;
  display: block;
}
.course-classifylist > li {
  padding: 8px 20px 8px 8px;
}
.styleGreen {
  color: #00cf8c;
}

// /deep/.ant-btn-primary {
//   background: rgb(35, 134, 158);
// }
</style>